A device-to-device (D2D) communication mode is a communication mode in which a transmit end directly sends data to a receive end without forwarding by a base station or a cellular network. A special mode in the D2D communication mode is that user equipment (for example, remote user equipment, Remote UE) connects to a network by using another user equipment (relay device, Relay UE) having a relay function. In this mode of connecting to the network by using the relay device, the remote user equipment can smoothly access the network even if the remote user equipment is not within coverage of the network, and power consumption of the remote user equipment during the access can be reduced.
Before the remote user equipment accesses the network by using the relay device, the remote user equipment needs to first discover user equipment that may provide relay support for the remote user equipment. Currently, the user equipment supporting the relay function starts to perform a discovery process only after the user equipment obtains a resource configured by a base station and used for sending or receiving a discovery message and a Uu interface channel quality condition configured by the base station is satisfied. However, in this case, possibly the user equipment performing the discovery process cannot satisfy a relay requirement of the remote user equipment, and therefore the user equipment cannot be used by the remote user equipment. In this case, the discovery process performed by the user equipment is a futile discovery process. Consequently, unnecessary power consumption is caused.